#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<malloc.h>
int* findDisappearedNumbers(int* nums, int numsSize, int* returnSize) {
    int* num = malloc((numsSize + 1) * sizeof(int));
    for (int i = 0; i < numsSize; i++)
    {
        num[nums[i]] = 1;
    }
    *returnSize = 0;
    for (int i = 1; i <= numsSize; i++)
    {
        if (num[i] != 1)
        {
            nums[(*returnSize)++] = i;
        }
    }
    return nums;
}

int main()
{
    int nums[8] = { 4,3,2,7,8,2,3,1 };
    int returnSize = 0;
    int *p=findDisappearedNumbers(nums, 8, &returnSize);
    for (int i = 0; i < returnSize; i++)
    {
        printf("%d ", p[i]);
    }
    return 0;
}